<?php

/**
 * ECSHOP
 * ============================================================================
 * 版权所有 2005-2010 上海商派网络科技有限公司，并保留所有权利。
 * 网站地址: http://www.ecshop.com；
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用；不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 *
 * $Author: liuhui $
 * $Id: goods_export.php 17107 2010-04-15 03:29:13Z liuhui $
*/

define('IN_ECS', true);

require(dirname(__FILE__) . '/includes/init.php');


if ($_REQUEST['act'] == 'goods_deploy')
{
    /* 检查权限 */
    admin_priv('goods_deploy');
    $start_date = date("Y-m-d",strtotime("-1 year"));   
    $smarty->assign('start_date', $start_date);
  
   //统计待发布产品总数
    $sql="select count(*) from ".$ecs->table('goods_export');
    $totalcount=$db->getOne($sql);
     
    //统计已翻译产品数量，即可发布产品数量
    $sql="select count(*) from ".$ecs->table('goods_export')." where is_trans=1";
    $transcount=$db->getOne($sql);
    //统计未翻译产品数量
     $notranscount=$totalcount-$transcount;
     $smarty->assign('totalcount', $totalcount);
     $smarty->assign('transcount', $transcount);
     $smarty->assign('notranscount', $notranscount);
    if($totalcount>0){
	 	 $smarty->assign('deploy_info', $_LANG['deploy_info']);
	 	 $smarty->display('goods_deploy.htm');
    }else{
    	 sys_msg($_LANG['deploy_goods_empty'], 0, $link);
    }
     assign_query_info();
    
   
  
}elseif ($_REQUEST['act'] == 'deploy_ok'){
	$db->query('truncate ecs_goods_export');
	$link[0] = array('href'=>'goods.php?act=list','text'=>'back');
	sys_msg('完成发布确认信息提交成功', 0, $link);
}



?>